package controllers;
import java.io.PrintStream;

public class Log{
	public static void setEnabled(boolean en){
		Log.enabled=en;
	}
	public static void print(String stringToPrint){
		if(enabled)out.print(stringToPrint);
	}
	public static void print(Exception e){
		if(enabled)
		e.printStackTrace(err);
	}
	public static void println(String stringToPrint){
		out.print(stringToPrint+"\n");
	}
	public static void printErr(String stringToPrint){
		if(enabled)err.print("[Error]\t"+stringToPrint);
	}
	public static void printlnErr(String stringToPrint){
		err.print(stringToPrint+"\n");
	}
	public static boolean isEnabled(){
		return enabled;
	}
	private static PrintStream out=System.out;
	private static PrintStream err=System.err;
	private static Boolean enabled=false;
}
